#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File    :   EOL_test.py
@Time    :   2023/09/01 10:50:28
@Author  :   YangLiang 
@Version :   1.0
@Contact :   yangliang@chengtech.com
@License :   (C)Copyright 2022-2025
@Desc    :   None
'''

# here put the import lib
from pytest_assume.plugin import assume
 
import pytest
import time
import requests
from sklearn.metrics import jaccard_score
from sympy import I
# from sympy import assuming
from commDriver.TS_CAN import *
import allure
import sys
from collections.abc import Iterable

from sqlalchemy import false
sys.dont_write_bytecode = True
import Set_up
from DbfV2 import *

writeDBf = DbfV2()

txCmd = bytearray()

FactoryWorkModels_NoSecurityCertificate = [ ([0x01,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]),            
                                            ([0x02,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]),
                                            ] 

FactoryWorkModels_Failed = [    ([0x06,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]),            
                                ([0x05,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]),
                                ([0x01,0x32,0x58,0xAF,0x00,0x00,0x00,0x00]),
                                ([0x01,0x31,0x59,0xAF,0x00,0x00,0x00,0x00]),
                                ([0x01,0x31,0x59,0xA0,0x00,0x00,0x00,0x00]),
                                ([0x02,0x32,0x58,0xAF,0x00,0x00,0x00,0x00]),
                                ([0x02,0x31,0x59,0xAF,0x00,0x00,0x00,0x00]),
                                ([0x02,0x31,0x59,0xA0,0x00,0x00,0x00,0x00])]  

ClearFlash_Failed = [   ([0xA6,0xA5,0xA5,0xA5,0x5A,0x5A,0x5A,0x5A]),            
                        ([0xA5,0xA6,0xA5,0xA5,0x5A,0x5A,0x5A,0x5A]),
                        ([0xA5,0xA5,0xA6,0xA5,0x5A,0x5A,0x5A,0x5A]),
                        ([0xA6,0xA5,0xA5,0xA6,0x5A,0x5A,0x5A,0x5A]),
                        ([0xA5,0xA5,0xA5,0xA5,0x6A,0x5A,0x5A,0x5A]),
                        ([0xA5,0xA5,0xA5,0xA5,0x5A,0x6A,0x5A,0x5A]),
                        ([0xA5,0xA5,0xA5,0xA5,0x5A,0x5A,0x6A,0x5A]),
                        ([0xA5,0xA5,0xA5,0xA5,0x5A,0x5A,0x5A,0x6A])] 

ReadSoftVer_Failed = [  ([0x82,0x01,0x00,0x00,0x00,0x00,0x00,0x00]),            
                        ([0x82,0x00,0x01,0x00,0x00,0x00,0x00,0x00]),
                        ([0x82,0x00,0x00,0x01,0x00,0x00,0x00,0x00]),
                        ([0x82,0x00,0x00,0x00,0x01,0x00,0x00,0x00]),
                        ([0x82,0x00,0x00,0x00,0x00,0x01,0x00,0x00]),
                        ([0x82,0x00,0x00,0x00,0x00,0x00,0x01,0x00]),
                        ([0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x01])] 

ReadHdVer_Failed = [    ([0x81,0x01,0x00,0x00,0x00,0x00,0x00,0x00]),            
                        ([0x81,0x00,0x01,0x00,0x00,0x00,0x00,0x00]),
                        ([0x81,0x00,0x00,0x01,0x00,0x00,0x00,0x00]),
                        ([0x81,0x00,0x00,0x00,0x01,0x00,0x00,0x00]),
                        ([0x81,0x00,0x00,0x00,0x00,0x01,0x00,0x00]),
                        ([0x81,0x00,0x00,0x00,0x00,0x00,0x01,0x00]),
                        ([0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x01])] 

ReadCalibrationVer_Failed = [   ([0x83,0x01,0x00,0x00,0x00,0x00,0x00,0x00]),            
                                ([0x83,0x00,0x01,0x00,0x00,0x00,0x00,0x00]),
                                ([0x83,0x00,0x00,0x01,0x00,0x00,0x00,0x00]),
                                ([0x83,0x00,0x00,0x00,0x01,0x00,0x00,0x00]),
                                ([0x83,0x00,0x00,0x00,0x00,0x01,0x00,0x00]),
                                ([0x83,0x00,0x00,0x00,0x00,0x00,0x01,0x00]),
                                ([0x83,0x00,0x00,0x00,0x00,0x00,0x00,0x01])]

Ver_Failed = [  ([0x85,0x01,0x00,0x00,0x00,0x00,0x00,0x00]),            
                ([0x86,0x00,0x01,0x00,0x00,0x00,0x00,0x00]),
                ([0x87,0x00,0x00,0x01,0x00,0x00,0x00,0x00]),
                ([0x88,0x00,0x00,0x00,0x01,0x00,0x00,0x00]),
                ([0x04,0x00,0x00,0x00,0x00,0x01,0x00,0x00]),
                ([0x05,0x00,0x00,0x00,0x00,0x00,0x01,0x00]),
                ([0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x01])]

Trigger2DFFT_Failed = [ ([0x02,0x32,0x58,0xAF,0x00,0x00,0x00,0x00]),            
                        ([0x02,0x31,0x59,0xAF,0x00,0x00,0x00,0x00]),
                        ([0x02,0x31,0x58,0xAB,0x00,0x00,0x00,0x00]),
                        ([0x03,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]),
                        ([0x02,0x31,0x58,0xAF,0x01,0x00,0x00,0x00]),
                        ([0x02,0x31,0x58,0xAF,0x00,0x01,0x00,0x00]),
                        ([0x02,0x31,0x58,0xAF,0x00,0x00,0x02,0x00]),
                        ([0x02,0x31,0x58,0xAF,0x00,0x00,0x00,0x01])]

GetDBFType_Failed = [   ([0x01,0x02,0x01,0x00,0x00,0x00,0x00,0x00]),            
                        ([0x01,0x00,0x10,0x00,0x00,0x00,0x00,0x00]),
                        ([0x01,0x00,0x01,0x01,0x00,0x00,0x00,0x00]),
                        ([0x01,0x00,0x01,0x00,0x01,0x00,0x00,0x00]),
                        ([0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x01])]

WriteRCS_Failed = [ ([0x12,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]),            
                    ([0x01,0x32,0x58,0xAF,0x00,0x00,0x00,0x00]),
                    ([0x01,0x31,0x59,0xAF,0x00,0x00,0x00,0x00]),
                    ([0x01,0x31,0x58,0xAA,0x00,0x00,0x00,0x00]),
                    ([0x01,0x31,0x58,0xAF,0x00,0x00,0x01,0x00]),
                    ([0x01,0x31,0x58,0xAF,0x00,0x00,0x00,0x01])]

SaveData_Failed = [ ([0xA5,0x00,0x00,0x00,0x00,0x00,0x00,0x00]),            
                    ([0xA1,0x01,0x00,0x00,0x00,0x00,0x00,0x00]),
                    ([0xA1,0x00,0x01,0x00,0x00,0x00,0x00,0x00]),
                    ([0xA1,0x00,0x00,0x01,0x00,0x00,0x00,0x00]),
                    ([0xA1,0x00,0x00,0x00,0x01,0x00,0x00,0x00]),
                    ([0xA1,0x00,0x00,0x00,0x00,0x01,0x00,0x00]),
                    ([0xA1,0x00,0x00,0x00,0x00,0x00,0x01,0x00]),
                    ([0xA1,0x00,0x00,0x00,0x00,0x00,0x00,0x01]),
                    ([0xA2,0x00,0x00,0x00,0x00,0x00,0x00,0x00])]

ChangeProfile_Failed = [    ([0x02,0x32,0x58,0xAF,0x00,0x00,0x00,0x00]),            
                            ([0x02,0x31,0x59,0xAF,0x00,0x00,0x00,0x00]),
                            ([0x02,0x31,0x58,0xAA,0x00,0x00,0x00,0x00]),
                            ([0x02,0x31,0x58,0xAF,0x01,0x00,0x00,0x00]),
                            ([0x02,0x31,0x58,0xAF,0x00,0x01,0x00,0x00]),
                            ([0x02,0x31,0x58,0xAF,0x00,0x00,0x02,0x00]),
                            ([0x02,0x31,0x58,0xAF,0x00,0x00,0x00,0x03]),
                            ([0x10,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]),
                            ([0x12,0x31,0x58,0xAF,0x00,0x00,0x00,0x00])]

ResetDog_Failed = [ ([0x32,0x58,0xAF,0x00,0x01,0x00,0x00,0x00]),            
                    ([0x31,0x59,0xAF,0x00,0x01,0x00,0x00,0x00]),
                    ([0x31,0x58,0xA0,0x00,0x01,0x00,0x00,0x00]),
                    ([0x31,0x58,0xAF,0x01,0x01,0x00,0x00,0x00]),
                    ([0x31,0x58,0xAF,0x00,0x02,0x00,0x00,0x00]),
                    ([0x31,0x58,0xAF,0x00,0x01,0x03,0x00,0x00]),
                    ([0x31,0x58,0xAF,0x00,0x01,0x00,0x04,0x00]),
                    ([0x31,0x58,0xAF,0x00,0x01,0x00,0x00,0x05])]

QueryTime_Failed = [([0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00]),            
                    ([0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00]),
                    ([0x80,0x00,0x01,0x00,0x00,0x00,0x00,0x00]),
                    ([0x80,0x00,0x00,0x01,0x00,0x00,0x00,0x00]),
                    ([0x80,0x00,0x00,0x00,0x01,0x00,0x00,0x00]),
                    ([0x80,0x00,0x00,0x00,0x00,0x01,0x00,0x00]),
                    ([0x80,0x00,0x00,0x00,0x00,0x00,0x01,0x00]),
                    ([0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x01])]

MountID_Failed = [  ([0x01,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]),            
                    ([0x00,0x32,0x58,0xAF,0x00,0x00,0x00,0x00]),
                    ([0x00,0x31,0x59,0xAF,0x00,0x00,0x00,0x00]),
                    ([0x00,0x31,0x58,0xA0,0x00,0x00,0x00,0x00]),
                    ([0x00,0x31,0x58,0xAF,0x01,0x00,0x00,0x00]),
                    ([0x00,0x31,0x58,0xAF,0x00,0x02,0x00,0x00]),
                    ([0x00,0x31,0x58,0xAF,0x00,0x00,0x03,0x00]),
                    ([0x00,0x31,0x58,0xAF,0x00,0x00,0x00,0x04])] 

ReadVoltage_Failed = [  ([0x91,0x00,0x00,0x00,0x00,0x00,0x00,0x00]),            
                        ([0x90,0x01,0x00,0x00,0x00,0x00,0x00,0x00]),
                        ([0x90,0x00,0x02,0x00,0x00,0x00,0x00,0x00]),
                        ([0x90,0x00,0x00,0x03,0x00,0x00,0x00,0x00]),
                        ([0x90,0x00,0x00,0x00,0x04,0x00,0x00,0x00]),
                        ([0x90,0x00,0x00,0x00,0x00,0x05,0x00,0x00]),
                        ([0x90,0x00,0x00,0x00,0x00,0x00,0x06,0x00]),
                        ([0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x07])] 

TransAndWriteDBF_Failed = [ ([0x82,0x00,0x1C,0x70,0x00,0x00,0x10,0x00]),            
                            ([0x83,0x00,0x1C,0x70,0x00,0x00,0x10,0x00]),
                            ([0x85,0x00,0x1C,0x70,0x00,0x00,0x10,0x00]),
                            ([0x86,0x00,0x1C,0x70,0x00,0x00,0x10,0x00]),
                            ([0x88,0x00,0x1C,0x70,0x00,0x00,0x10,0x00]),
                            ([0x8A,0x00,0x1C,0x70,0x00,0x00,0x10,0x00]),
                            ([0x8F,0x00,0x1C,0x70,0x00,0x00,0x10,0x00]),
                            ([0x8B,0x00,0x1C,0x70,0x00,0x00,0x10,0x00])] 


crcTable = list(range(256))

@allure.severity('critical')
class Test_EOL_Phy(object):

    
    '''EOL安全认证'''
    def EOL_SecurityCertificate(self,Driver, iStep = 2, message = True):
        txCmd = [0x0E,0x31,0x58,0xAF,0x00,0x00,0x00,0x46]
        if message:
            with allure.step(f"Step{iStep}:安全认证请求 # 安全认证返回"):
                iStep = iStep + 1
        logging.info("^^^^^^^^^^^^^^EOL安全认证请求^^^^^^^^^^^^^^")
        receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x100, txCmd, 0x200)
        with assume: assert receive_Data[0:2] == [0x0E,0x31]

        txCmd[0] = 0x0F
        txCmd[4] = receive_Data[4]
        txCmd[5] = receive_Data[5]
        txCmd[6] = receive_Data[6]
        txCmd[7] = (sum(receive_Data[0:7]) + 1) & 0XFF

        if message:
            with allure.step(f"Step{iStep}: 安全认证确认 # 安全认证确认结果"):
                iStep = iStep + 1
        logging.info("^^^^^^^^^^^^^^EOL安全认证确认^^^^^^^^^^^^^^")
        receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x100, txCmd, 0x200)
        with assume: assert receive_Data[0:8] == [0x0F,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]
            
        
        return iStep

    '''EOL雷达状态0:关闭  1:进入工厂模式  2:进入校准模式  FF:雷达重启'''
    def EOL_Factory_WorkModels(self, Driver, model = 'Factory', iStep = 4, message = True):
        if model == 'Factory':
            cmd = 0x01
        if model == 'Calibration':
            cmd = 0x02
        if model == 'Reset':
            cmd = 0xFF
        if model == 'Close':
            cmd = 0x00

        txCmd = [cmd,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]
        if message:
            with allure.step(f"Step{iStep}:生产模式请求 # 生产模式返回"):
                iStep = iStep + 1
        logging.info("^^^^^^^^^^^^^^EOL生产模式{}^^^^^^^^^^^^^^".format(model)) 
        receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x100, txCmd, 0x200)
        if cmd != 0xFF:
            with assume: assert receive_Data[0:4] == [0x01,0x31,0x58,0xAF] 

        return iStep


    '''EOL CAN通信测试'''
    def EOL_CANCommunication(self, Driver,iStep = 4):
        txCmd = [0xA1,0xB2,0xC3,0xD4,0xA5,0xB6,0xC7,0xD8]
        with allure.step(f"Step{iStep}:CAN通信测试 # CAN通信测试结果"):
            logging.info("^^^^^^^^^^^^^^CAN通信测试^^^^^^^^^^^^^^")
            receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x00E, txCmd, 0x00E)
            with assume: assert receive_Data[0:8] == [0xA8,0xB7,0xC6,0xD5,0xA4,0xB3,0xC2,0xD1]
            iStep = iStep + 1

        return iStep


    '''EOL 清除Flash'''
    def EOL_ClearFlash(self, Driver,iStep = 4):
        testMessage = '清除Flash'
        txCmd = [0xA5,0xA5,0xA5,0xA5,0x5A,0x5A,0x5A,0x5A]

        with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x117, txCmd, 0x217,0.5)
            with assume: assert receive_Data[0:8] == [0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00]
            iStep = iStep + 1

        return iStep

    '''EOL RCS偏移量置0'''
    def EOL_SetRCSToZero(self, Driver,iStep = 4):
        testMessage = 'RCS偏移量置0'
        data = [(0x88,0x00,0x11,0x00,0x00,0x00,0x00,0x00), (0x00,0x72,0x63,0x73,0x6f,0x066,0x66,0x73),(0x01,0x65,0x74,0x20,0x30,0x20,0x30,0x20),
                (0x02,0x30,0x20,0x30,0x30,0x20,0x30,0x20), (0xff,0x30,0x20,0x30,0x30,0x20,0x30,0x20)]
        for i in range(5):
            txCmd.clear()
            for j in range(8):
                txCmd.append(data[i][j])
            with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
                logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
                receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x116, txCmd, 0x216)
                iStep = iStep + 1

        return iStep


    '''EOL版本查询校验 软件版本号查询0x82 硬件版本号查询0x81 校准版本号查询0x83 校准版本号写入0x03'''
    def EOL_ReadAndWriteVersion(self, Driver, type = 'ReadSw', iStep = 4, data = [0x00,0x00,0x00,0x00,0x00,0x00,0x00], message = True):
        if type == 'ReadSw':
            model = 0x82
            testMessage = '软件版本查询'
        if type == 'ReadHw':
            model = 0x81
            testMessage = '硬件版本查询'
        if type == 'ReadCaw':
            model = 0x83
            testMessage = '校准版本查询'
        if type == 'WriteCaw':
            model = 0x03
            testMessage = '校准版本写入'
        txCmd.clear()
        txCmd.append(model)
        
        for i in range(7):
            txCmd.append(data[i])
        if message:
            with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
                iStep = iStep + 1

        logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
        receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x103, txCmd, 0x203)
        with assume: assert receive_Data[0] == (model | 0x80)
            

        return iStep

    '''EOL读取电压'''
    def EOL_ReadVoltage(self, Driver,iStep = 4):
        testMessage = '读取PCBA电压'
        txCmd = [0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00]

        with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x140, txCmd, 0x240)
            with assume: assert receive_Data[0] & 0xF0 == 0x90
            iStep = iStep + 1

        return iStep

    '''EOL看门狗复位'''
    def EOL_ResetDog(self, Driver,iStep = 4):
        testMessage = '看门狗复位'
        txCmd = [0x31,0x58,0xAF,0x00,0x01,0x00,0x00,0x00]

        with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x136, txCmd, 0x236)
            with assume: assert receive_Data[0:8] == [0x31,0x58,0xAF,0x00,0x01,0x01,0x00,0x00]
            iStep = iStep + 1

        return iStep

    '''EOL雷达系统时间戳'''
    def EOL_QueryTime(self, Driver,iStep = 4):
        testMessage = '查询雷达系统时间戳'
        txCmd = [0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00]

        with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x142, txCmd, 0x242)
            with assume: assert receive_Data[0] == 0x80
            iStep = iStep + 1

        return iStep
    
    '''EOL DTC检测'''
    def EOL_CheckDTC(self, Driver,iStep = 4):
        testMessage = 'DTC检测'
        txCmd = [0x03,0x19,0x02,0x09,0x00,0x00,0x00,0x00]

        with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x760, txCmd, 0x768)
            with assume: assert receive_Data[0] == 0x10
            iStep = iStep + 1
            txCmd = [0x30,0x00,0x00,0x55,0x55,0x55,0x55,0x55]
            receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x760, txCmd, 0x768)

        return iStep

    
    '''EOL SN写入读取 model=0:write model=1:read'''
    def EOL_WriteAndReadSn(self, Driver, model = 'Write', iStep = 4,data = [(0x21,0x01,0x02,0x03,0x04,0x05,0x06,0x07), (0x22,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E),(0x23,0x0F,0x10,0x11,0x12,0x13,0x14,0x15)]):
        testMessage = 'SN写入'
        for i in range(3):
            txCmd.clear()
            for j in range(8):
                txCmd.append(data[i][j])
            if model == 'Read':
                testMessage = 'SN读取'
                txCmd[0] = 0xA1 + i
            with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
                logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
                receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x105, txCmd, 0x205)
                with assume: assert receive_Data[0] == 0xA1 + i
                for i in range(1,8):
                    with assume: assert receive_Data[i] == txCmd[i]


                iStep = iStep + 1
            time.sleep(0.05)

        return iStep


    '''EOL 存储数据'''
    def EOL_SaveData(self, Driver,iStep = 4, message = True):
        testMessage = '存储数据'
        txCmd = [0xA1,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
        if message:
            with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
                iStep = iStep + 1
        logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
        receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x116, txCmd, 0x216, 0.5)
        with assume: assert receive_Data[0:8] == [0x01,0x11,0x11,0x11,0x11,0x11,0x11,0x11]
            

        return iStep

    
    '''EOL 切换Profile目标'''
    def EOL_ChangeProfile(self, Driver, iStep = 4,profile = 0x01, Message = True):
        testMessage = '切换Profile目标'
        txCmd = [profile,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]
        if Message:
            with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
                iStep = iStep + 1
        logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
        receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x150, txCmd, 0x250)
        with assume: assert receive_Data[0:7] == [profile,0x31,0x58,0xAF,0x00,0x00,0x00]
                
        return iStep

    
    '''EOL Mount ID_Pin7/Pin8引脚状态检测'''
    def EOL_MountID(self, Driver, iStep = 4):
        testMessage = 'Mount ID_Pin7/Pin8引脚状态检测'
        txCmd = [0x00,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]
        with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x156, txCmd, 0x256)
            with assume: assert receive_Data[0:8] == [0x01,0x01,0x31,0x58,0xAF,0x00,0x00,0x00]
            iStep = iStep + 1

        return iStep

    
    '''触发式发送2D-FFT模式'''
    def EOL_Trigger_2DFFT(self, Driver, iStep = 4):
        testMessage = '触发式发送2D-FFT模式'
        txCmd = [0x02,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]
        with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x153, txCmd, 0x253)
            with assume: assert receive_Data[0:8] == [0x02,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]
            iStep = iStep + 1

        testMessage = '上传一次2D-FFT模式'
        txCmd = [0x0B,0x31,0x58,0x00,0x00,0x00,0x00,0x01]
        with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x153, txCmd, 0x253)
            with assume: assert receive_Data[0:8] == [0x0B,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]
            iStep = iStep + 1

        return iStep

    '''DBF因子的获取方式'''
    def EOL_GetDBFType(self, Driver, iStep = 4):
        testMessage = 'DBF因子的获取方式'
        txCmd = [0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00]
        with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x109, txCmd, 0x209)
            with assume: assert receive_Data[0:8] == [0x21,0x00,0x01,0x00,0x00,0x00,0x00,0x00]
            iStep = iStep + 1

        return iStep

    '''RCS标定值写入'''
    def EOL_WriteRCS(self, Driver, iStep = 4):
        testMessage = 'RCS标定值写入'
        txCmd = [0x01,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]

        with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x127, txCmd, 0x227)
            with assume: assert receive_Data[0] == 0x20
            iStep = iStep + 1

        return iStep


    '''曲线拟合的天线间距及相位差写入'''
    def EOL_WritePhaseDifference(self, Driver, iStep = 4):
        testMessage = '曲线拟合的天线间距及相位差写入'
        txCmd = [0x01,0x02,0x03,0x04,0x00,0x00,0x00,0x00]

        with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x114, txCmd, 0x214)
            with assume: assert receive_Data != []
            iStep = iStep + 1

        return iStep

    
    '''传递与写入DBF因子'''
    def EOL_TransAndWriteDBF(self, Driver, iStep = 4):
        testMessage = '传递与写入DBF因子'
        txCmd = [0x8D, 0x00, 0x1C, 0x70, 0x00, 0x00, 0x10, 0x00]

        with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x154, txCmd, 0x254)
            with assume: assert receive_Data[0] ==0x8d
            iStep = iStep + 1

        return iStep

    
    def EOL_Eirp_test(self,Driver,data):
        logging.info('设置CW波及EIRP测试')
        request_data = data
        receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x101, request_data, 0x201)
        with assume: assert receive_Data[0:1] == [0x20] 

    def FACTORY_CALIBRATION_MODE_REQ(self,Driver,n=0):
        logging.info('上位机发送0x153控制雷达进入模式{}'.format(n))
        if n == 0:
            mode = 0x01
        elif n == 1:
            mode = 0x0A
        elif n == 2:
            mode = 0x02
        elif n == 3:
            mode = 0x0B
        else:
            mode = 0x00
        request_data = [mode,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]

        receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x153, request_data, 0x253,0.05)
        with assume: assert receive_Data[0:4] == [mode,0x31,0x58,0xAF]           #比对触发模式回复
        return receive_Data


    def get_radar_2dfft_data(self,Driver):
        #触发模式切换 0x153/0x253
        with allure.step('进入触发发送2D-FFT模式'):       
            logging.info('进入触发发送2D-FFT模式')
            ALl_data = self.FACTORY_CALIBRATION_MODE_REQ(Driver,2)  

        with allure.step('触发一次发波+雷达发送目标的2d-fft复合数据'):  
            logging.info('触发一次发波+雷达发送目标的2d-fft复合数据 ')
            for i in range(75):
                request_data = [0x0B,0x31,0x58,0xAF,0x00,i+181,0x14,0x00]

                receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x153, request_data, 0x213, 0.05)
                with assume: assert len(receive_Data) == 8
                time.sleep(0.01)

            for i in range(76):
                request_data = [0x0B,0x31,0x58,0xAF,0x00,i,0x14,0x00]

                receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x153, request_data, 0x213, 0.05)
                with assume: assert len(receive_Data) == 8
                time.sleep(0.01)
        
    def send_data_114(self,Driver,func,profiles):
        #曲线拟合的天线间距及相位差写入0x114
        with allure.step('曲线拟合的天线间距及相位差写入'):       
            logging.info('曲线拟合的天线间距及相位差写入')
            request_data = [0,0,0,0,0,0,0,0]
            request_data[0] = ((func&0xF)<<4)|((profiles&0xF0)>>4)
            time.sleep(0.01)
            for i in range(16):
                request_data[1] = ((profiles&0xf)<<4)|((i&0xF0)>>4)
                request_data[2] = ((i&0xf)<<4)|(0x00)
                logging.info('0x114 send data -- function is: {0}, profile is: {1}, channel is: {2}'.format(func,profiles,i))
                sendstr = binascii.b2a_hex(bytearray(request_data),' ')
                # logging.info('request_data is :{}'.format(sendstr))
                receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x114, request_data, 0x214)
                with assume: assert receive_Data[0:3] == request_data[0:3]

    def radar_cal_mode(self,Driver,func,profiles):
        logging.info('雷达校准值调用方式')
        request_data = [0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
        request_data[1] = func
        request_data[2] = profiles

        receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x109, request_data, 0x209)
        
        with assume: assert receive_Data[0] == 0x21        #比对进入正常模式

    def get_data(self,Driver,delaytime = 0.5):
        logging.info('获取数据')
        Driver['CAN2'].fush_q_buff()  # 清缓存
        time.sleep(delaytime)
        ALl_data,buffer_size = Driver['CAN2'].read_frame()
        return ALl_data

    def data_number(self,ALl_data,ID):
        logging.info('数据筛选,ID is:'+hex(ID)+',确认触发数量。')
        Data = ALl_data[ALl_data['AIdentifier']==ID]
        logging.info('ID number of frame is:{}'.format(len(Data)))
        with assume: assert len(Data) >= 1          #判断数据发出

    def read_mag_snr(self,Driver):
        logging.info('读取MAG,SNR,RCS')
        logging.info('切换Profile0')
        self.EOL_ChangeProfile(Driver,1,0,False)
        ALl_data = self.get_data(Driver,1)
        logging.info('获取目标列表信息')
        self.data_number(ALl_data,0x500)
        self.data_number(ALl_data,0x600)
        logging.info('切换Profile1')
        self.EOL_ChangeProfile(Driver,1,1,False)
        ALl_data = self.get_data(Driver,1)
        logging.info('获取目标列表信息')
        self.data_number(ALl_data,0x500)
        self.data_number(ALl_data,0x600)

    
    def write_rcs(self,Driver,data):
        logging.info('RCS标定值写入')
        request_data = data
        
        receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x127, request_data, 0x227)
        with assume: assert receive_Data[0] == 0x20

    def targe_tperformance_detection(self,Driver):
        logging.info('目标性能检测')
        logging.info('切换Profile0')
        self.EOL_ChangeProfile(Driver,1,0,False)
        ALl_data = self.get_data(Driver,1)
        logging.info('获取目标列表信息')
        self.data_number(ALl_data,0x500)
        self.data_number(ALl_data,0x600)
        logging.info('切换Profile1')
        self.EOL_ChangeProfile(Driver,1,1,False)
        ALl_data = self.get_data(Driver,1)
        logging.info('获取目标列表信息')
        self.data_number(ALl_data,0x500)
        self.data_number(ALl_data,0x600)


    ''''测试脚本'''

    @allure.story('ECU EOL Test')
    @allure.title('Test eol test')
    @allure.description('Test eol test')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    def test_EOL_test_Phy(self,action,set_rbs,Driver):
        iStep = 1
        Driver['power'].Enable(False)
        time.sleep(1)
        Driver['power'].Enable(True)
        time.sleep(2)
        with allure.step(f'iStep{iStep}:检查雷达工作电压与电流'):
            logging.info(f'Step{iStep}:检查雷达工作电压与电流')
            v,i = Driver['power'].Read_Measure()
            with assume: assert i > 0.05
            iStep = iStep + 1

        '''安全认证'''
        iStep = self.EOL_SecurityCertificate(Driver,iStep)

        '''生产模式'''
        iStep = self.EOL_Factory_WorkModels(Driver,'Factory',iStep)

        '''CW波及EIRP测试'''
        with allure.step(f'Step{iStep}:设置CW波及EIRP测试'):
            logging.info(f'Step{iStep}:设置CW波及EIRP测试')
            iStep = self.EOL_ChangeProfile(Driver,iStep,1, False)
            self.EOL_Eirp_test(Driver,data = [0x00,0x98,0x96,0x00,0x00,0x00,0x00,0x00])
            time.sleep(0.05)
            self.EOL_Eirp_test(Driver,data = [0x00,0x98,0xFA,0x00,0x00,0x00,0x00,0x00])
            time.sleep(0.05)
            self.EOL_Eirp_test(Driver,data = [0x00,0x99,0x90,0x00,0x00,0x00,0x00,0x00])
            time.sleep(0.05)
            iStep = self.EOL_ChangeProfile(Driver,iStep,1, False)
            self.EOL_Eirp_test(Driver,data = [0x00,0x98,0x96,0x00,0x00,0x00,0x00,0x00])
            time.sleep(0.05)
            self.EOL_Eirp_test(Driver,data = [0x00,0x98,0xFA,0x00,0x00,0x00,0x00,0x00])
            time.sleep(0.05)
            self.EOL_Eirp_test(Driver,data = [0x00,0x99,0x90,0x00,0x00,0x00,0x00,0x00])
            time.sleep(0.05)
            iStep = iStep +1

        '''读取SN信息'''
        iStep = self.EOL_WriteAndReadSn(Driver, 'Read', iStep)

        '''清除Flash数据'''
        iStep = self.EOL_ClearFlash(Driver, iStep)

        '''重启'''
        iStep = self.EOL_Factory_WorkModels(Driver, 'Reset', iStep)
        
        '''断电重启读电流'''
        Driver['power'].Enable(False)
        time.sleep(1)
        Driver['power'].Enable(True)
        time.sleep(2)
        v,i = Driver['power'].Read_Measure()
        with assume: assert i > 0.05

        '''安全认证'''
        iStep = self.EOL_SecurityCertificate(Driver,iStep)

        '''VCAN测试'''
        iStep = self.EOL_CANCommunication(Driver, iStep)

        '''软件读取工作电压'''
        # iStep = self.EOL_ReadVoltage(Driver, iStep)

 
        '''软件版本号查询'''
        iStep = self.EOL_ReadAndWriteVersion(Driver, 'ReadSw',iStep)

        '''硬件版本号查询'''
        iStep = self.EOL_ReadAndWriteVersion(Driver, 'ReadHw',iStep)

        '''校验版本号查询'''
        iStep = self.EOL_ReadAndWriteVersion(Driver, 'ReadCaw',iStep)

        '''校验版本号写入'''
        iStep = self.EOL_ReadAndWriteVersion(Driver, 'WriteCaw',iStep, [0x08,0x08,0x08,0x00,0x00,0x00,0x00])

        '''校验版本号查询'''
        iStep = self.EOL_ReadAndWriteVersion(Driver, 'ReadCaw',iStep)

        '''SN码写测试'''
        iStep = self.EOL_WriteAndReadSn(Driver, 'Write',iStep)

        '''SN码读测试'''
        iStep = self.EOL_WriteAndReadSn(Driver, 'Read',iStep)

        '''保存数据'''
        iStep = self.EOL_SaveData(Driver,iStep)

        '''生产模式-校准模式'''
        iStep = self.EOL_Factory_WorkModels(Driver,'Calibration',iStep)


        '''天线校准'''
        with allure.step(f'Step{iStep}:天线校准'):
            logging.info(f'Step{iStep}:天线校准')
            time.sleep(0.05)
            self.get_radar_2dfft_data(Driver)
            time.sleep(0.05)
            iStep = self.EOL_Factory_WorkModels(Driver,'Factory',iStep)
            time.sleep(0.05)
            self.send_data_114(Driver,1,0)
            self.send_data_114(Driver,1,1)
            self.send_data_114(Driver,2,0)
            self.send_data_114(Driver,2,1)
            '''校验版本号写入'''
            self.EOL_ReadAndWriteVersion(Driver,'WriteCaw',iStep,[0x08,0x08,0x00,0x00,0x00,0x00,0x00], False)
            '''校验版本号查询'''
            self.EOL_ReadAndWriteVersion(Driver,'ReadCaw',iStep)
            self.radar_cal_mode(Driver,0,0)
            self.radar_cal_mode(Driver,0,1)
            time.sleep(0.1)
            self.EOL_SaveData(Driver,iStep, False)
            time.sleep(0.1)


        '''写入DBF因子'''
        writeDBf.WritedbfV2(Driver)

        # '''看门狗复位'''
        # iStep = self.EOL_ResetDog(Driver, iStep)


        # with allure.step('Step12:查询雷达系统时间戳'):
        #     logging.info('Step12:查询雷达系统时间戳')
        #     self.query_time(Driver)


        # with allure.step('Step12:底噪测试'):
        #     logging.info('Step12:底噪测试')
        #     self.noise_test(Driver)

        with allure.step(f'Step{iStep}:目标MAG、SNR测试及RCS标定'):
            logging.info(f'Step{iStep}:目标MAG、SNR测试及RCS标定')
            '''安全认证'''
            iStep = self.EOL_SecurityCertificate(Driver,iStep,False)

            '''生产模式'''
            iStep = self.EOL_Factory_WorkModels(Driver,'Factory',iStep,False)
            self.read_mag_snr(Driver)
            self.write_rcs(Driver,data=[0x00,0x31,0x58,0xAF,0x00,0x07,0x00,0x00])
            self.write_rcs(Driver,data=[0x01,0x31,0x58,0xAF,0xFF,0xF9,0x00,0x00])

            '''保存数据'''
            iStep = self.EOL_SaveData(Driver,iStep, False)

            Driver['power'].Enable(False)
            time.sleep(1)
            Driver['power'].Enable(True)
            time.sleep(2)
            v,i = Driver['power'].Read_Measure()
            with assume: assert i > 0.05

            '''安全认证'''
            iStep = self.EOL_SecurityCertificate(Driver,iStep,False)

            '''生产模式'''
            iStep = self.EOL_Factory_WorkModels(Driver,'Factory',iStep,False)
            # self.data_select(normal_data,0x500)

        with allure.step('Step14:目标检测性能综合测试 '):
            logging.info('Step14:目标检测性能综合测试')
            self.targe_tperformance_detection(Driver)

        # with allure.step('Step15:MountID_车身状态检车'):
        #     logging.info('Step15:MountID_车身状态检车')
        #     self.mountid_test(Driver)
        #     time.sleep(1)

        # iStep = self.EOL_Factory_WorkModels(Driver,'Close',iStep)

    def test_WritedbfV2(self,Driver,action):
        iStep = 1
        writeDBf.WritedbfV2(Driver)

    
    
    '''异常测试'''
    @allure.story('ECU EOL Test : Security Certificatrere Quest Failed')
    @allure.title('Test eol test: Security Certificatrere Quest Failed')
    @allure.description('Test eol test: Security Certificatrere Quest Failed')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    def test_EOL_SecurityCertificatrere_QuestFailed_Phy(self,action,set_rbs,Driver):
        iStep = 1
        testMessage = "安全认证请求数据错误"
        txCmd = [0x0E,0x31,0x58,0xAF,0x00,0x00,0x00,0x40]
        with allure.step(f"Step{iStep}:安全认证请求 # 安全认证返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x100, txCmd, 0x200)
            with assume: assert receive_Data == []
            iStep = iStep + 1

    @allure.story('ECU EOL Test : Security Certificatrere Verify Failed')
    @allure.title('Test eol test: Security Certificatrere Verify Failed')
    @allure.description('Test eol test: Security Certificatrere Verify Failed')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    def test_EOL_SecurityCertificatrere_VerifyFailed_Phy(self,action,set_rbs,Driver):
        iStep = 1
        testMessage = "安全认证确认数据错误"
        txCmd = [0x0F,0x31,0x58,0xAF,0x00,0x10,0xD2,0x00]
        with allure.step(f"Step{iStep}:安全认证确认 # 安全认证确认返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x100, txCmd, 0x200)
            with assume: assert receive_Data == []
            iStep = iStep + 1

    ids = ["Request {0}".format(binascii.b2a_hex(bytearray(req),' ')) for req in FactoryWorkModels_NoSecurityCertificate]
    @allure.story('ECU EOL Test : Factory Work Models No Security Certificatrere')
    @allure.title('Test eol test: Factory Work Models No Security Certificatrere')
    @allure.description('Test eol test: Factory Work Models No Security Certificatrere')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    @pytest.mark.parametrize('req',FactoryWorkModels_NoSecurityCertificate,ids = ids)
    def test_EOL_FactoryWorkModels_NoSecurityCertificatrere_Phy(self,action,set_rbs,Driver,req):
        iStep = 1
        txCmd = req
        testMessage = '未安全认证-进入生产模式'

        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
        with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_Data = Driver['CAN'].SendAndRead_Eol(Driver, 0x100, txCmd, 0x200)
            with assume: assert receive_Data == []
            iStep = iStep + 1

    
    # ids = ["Request {0}".format(binascii.b2a_hex(bytearray(req),' ')) for req in FactoryWorkModels_Failed]
    # @allure.story('ECU EOL Test : Factory Work Models DataError')
    # @allure.title('Test eol test: Factory Work Models DataError')
    # @allure.description('Test eol test: Factory Work Models DataError')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # @pytest.mark.parametrize('req',FactoryWorkModels_Failed,ids = ids)
    # def test_EOL_FactoryWorkModels_DataError_Phy(self,action,set_rbs,Driver,req):
    #     iStep = 1
    #     txCmd = req
    #     testMessage = '生产模式数据错误'
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)

    #     with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x100,txCmd,0x200)
    #         with assume: assert receive_data[1:4] != [0x31,0x58,0xAF]
    #         iStep = iStep + 1


    @allure.story('ECU EOL Test : WriteSN No Security Certificatrere')
    @allure.title('Test eol test: WriteSN No Security Certificatrere')
    @allure.description('Test eol test: WriteSN No Security Certificatrere')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    def test_EOL_WriteSN_NoSecurityCertificatrere_Phy(self,action,set_rbs,Driver):
        iStep = 1
        '''先写入一次SN'''
        '''安全认证'''
        iStep = self.EOL_SecurityCertificate(Driver,iStep)
        '''读取SN'''
        iStep = self.EOL_WriteAndReadSn(Driver,'Write',iStep)
        '''存储数据'''
        iStep = self.EOL_SaveData(Driver,iStep)

        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
        data = [(0x21,0x08,0x02,0x03,0x04,0x05,0x06,0x08), (0x22,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E),(0x23,0x08,0x10,0x11,0x12,0x13,0x14,0x19)]
        testMessage = '未安全认证-SN写入'
        for i in range(3):
            txCmd.clear()
            for j in range(8):
                txCmd.append(data[i][j])
            with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
                logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
                receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x105,txCmd,0x205)
                with assume: assert receive_data == []

                iStep = iStep + 1
            time.sleep(0.5)

        
        '''读取SN判断是否被修改'''
        '''安全认证'''
        iStep = self.EOL_SecurityCertificate(Driver,iStep)
        '''读取SN'''
        iStep = self.EOL_WriteAndReadSn(Driver,'Read',iStep)

    # @allure.story('ECU EOL Test : WriteSN No Factory Models')
    # @allure.title('Test eol test: WriteSN No Factory Models')
    # @allure.description('Test eol test: WriteSN No Factory Models')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # def test_EOL_WriteSN_NoFactoryModels_Phy(self,action,set_rbs,Driver):
    #     iStep = 1
    #     '''先写入一次SN'''
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     '''读取SN'''
    #     iStep = self.EOL_WriteAndReadSn(Driver,'Write',iStep)
    #     '''存储数据'''
    #     iStep = self.EOL_SaveData(Driver,iStep)

    #     iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     data = [(0x21,0x08,0x02,0x03,0x04,0x05,0x06,0x08), (0x22,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E),(0x23,0x08,0x10,0x11,0x12,0x13,0x14,0x19)]
    #     testMessage = '未进入生产模式-SN写入'
    #     for i in range(3):
    #         txCmd.clear()
    #         for j in range(8):
    #             txCmd.append(data[i][j])
    #         with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
    #             logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #             receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x105,txCmd,0x205)
    #             with assume: assert receive_data == []

    #             iStep = iStep + 1
    #         time.sleep(0.5)

        
    #     '''读取SN判断是否被修改'''
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     '''读取SN'''
    #     iStep = self.EOL_WriteAndReadSn(Driver,'Read',iStep)

    # @allure.story('ECU EOL Test : WriteSN Data Error')
    # @allure.title('Test eol test: WriteSN Data Error')
    # @allure.description('Test eol test: WriteSN Data Error')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # def test_EOL_WriteSN_DataError_Phy(self,action,set_rbs,Driver):
    #     iStep = 1
    #     '''先写入一次SN'''
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     '''读取SN'''
    #     iStep = self.EOL_WriteAndReadSn(Driver,'Write',iStep)
    #     '''存储数据'''
    #     iStep = self.EOL_SaveData(Driver,iStep)

    #     data = [(0x25,0x03,0x02,0x03,0x04,0x05,0x06,0x07), (0x26,0x09,0x09,0x0A,0x0B,0x0C,0x0D,0x0E),(0x27,0x0F,0x10,0x11,0x12,0x13,0x14,0x19)]
    #     testMessage = 'SN写入数据错误'
    #     for i in range(3):
    #         txCmd.clear()
    #         for j in range(8):
    #             txCmd.append(data[i][j])
    #         with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
    #             logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #             receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x105,txCmd,0x205)
    #             with assume: assert receive_data != 0xA1 + i

    #             iStep = iStep + 1
    #         time.sleep(0.5)

    #     '''读取SN判断是否被修改'''
    #     '''读取SN'''
    #     iStep = self.EOL_WriteAndReadSn(Driver,'Read',iStep)

    @allure.story('ECU EOL Test : ReadSN No Security Certificatrere')
    @allure.title('Test eol test: ReadSN No Security Certificatrere')
    @allure.description('Test eol test: ReadSN No Security Certificatrere')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    def test_EOL_ReadSN_NoSecurityCertificatrere_Phy(self,action,set_rbs,Driver):
        iStep = 1
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
        data = [(0xA1,0x01,0x02,0x03,0x04,0x05,0x06,0x07), (0xA2,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E),(0xA3,0x0F,0x10,0x11,0x12,0x13,0x14,0x15)]
        testMessage = '未安全认证-SN读取'
        for i in range(3):
            txCmd.clear()
            for j in range(8):
                txCmd.append(data[i][j])
            with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
                logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
                receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x105,txCmd,0x205)
                with assume: assert receive_data == []

                iStep = iStep + 1
            time.sleep(0.5)

    # @allure.story('ECU EOL Test : ReadSN No Factory Models')
    # @allure.title('Test eol test: ReadSN No Factory Models')
    # @allure.description('Test eol test: ReadSN No Factory Models')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # def test_EOL_ReadSN_NoFactoryModels_Phy(self,action,set_rbs,Driver):
    #     iStep = 1
    #     iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     data = [(0xA1,0x01,0x02,0x03,0x04,0x05,0x06,0x07), (0xA2,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E),(0xA3,0x0F,0x10,0x11,0x12,0x13,0x14,0x15)]
    #     testMessage = '未进入生产模式-SN读取'
    #     for i in range(3):
    #         txCmd.clear()
    #         for j in range(8):
    #             txCmd.append(data[i][j])
    #         with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
    #             logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #             receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x105,txCmd,0x205)
    #             with assume: assert receive_data == []

    #             iStep = iStep + 1
    #         time.sleep(0.5)

    # @allure.story('ECU EOL Test : ReadSN Data Error')
    # @allure.title('Test eol test: ReadSN Data Error')
    # @allure.description('Test eol test: ReadSN Data Error')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # def test_EOL_ReadSN_DataError_Phy(self,action,set_rbs,Driver):
    #     iStep = 1
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     '''生产模式-普通模式'''
    #     iStep = self.EOL_Factory_WorkModels(Driver,'Factory',iStep)

    #     data = [(0xA5,0x01,0x02,0x03,0x04,0x05,0x06,0x07), (0xA6,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E),(0xA7,0x0F,0x10,0x11,0x12,0x13,0x14,0x15)]
    #     testMessage = 'SN读取数据错误'
    #     for i in range(3):
    #         txCmd.clear()
    #         for j in range(8):
    #             txCmd.append(data[i][j])
    #         with allure.step(f"Step{iStep}:{testMessage}请求 # {testMessage}返回"):
    #             logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #             receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x105,txCmd,0x205)
    #             with assume: assert receive_data != 0xA1 + i

    #             iStep = iStep + 1
    #         time.sleep(0.5)

    @allure.story('ECU EOL Test : ClearFlash No Security Certificatrere')
    @allure.title('Test eol test: ClearFlash No Security Certificatrere')
    @allure.description('Test eol test: ClearFlash No Security Certificatrere')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    def test_EOL_ClearFlash_NoSecurityCertificatrere_Phy(self,action,set_rbs,Driver):
        iStep = 1
        txCmd = [0xA5,0xA5,0xA5,0xA5,0xA5,0xA5,0xA5,0xA5]
        testMessage = '未安全认证-清除FLASH'
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
        with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x117,txCmd,0x217)
            with assume: assert receive_data == []
            iStep = iStep + 1
        
    # @allure.story('ECU EOL Test : ClearFlash No Factory Models')
    # @allure.title('Test eol test: ClearFlash No Factory Models')
    # @allure.description('Test eol test: ClearFlash No Factory Models')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # def test_EOL_ClearFlash_NoFactoryModels_Phy(self,action,set_rbs,Driver):
    #     iStep = 1
    #     txCmd = [0xA5,0xA5,0xA5,0xA5,0xA5,0xA5,0xA5,0xA5]
    #     testMessage = '未进生产模式-清除FLASH'
    #     iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x117,txCmd,0x217)
    #         with assume: assert receive_data == []
    #         iStep = iStep + 1

    # ids = ["Request {0}".format(binascii.b2a_hex(bytearray(req),' ')) for req in ClearFlash_Failed]
    # @allure.story('ECU EOL Test : ClearFlash Data Error')
    # @allure.title('Test eol test: ClearFlash Data Error')
    # @allure.description('Test eol test: ClearFlash Data Error')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # @pytest.mark.parametrize('req',ClearFlash_Failed,ids = ids)
    # def test_EOL_ClearFlash_DataError_Phy(self,action,set_rbs,Driver,req):
    #     iStep = 1
    #     txCmd = req
    #     testMessage = '清除FLASH数据错误'

    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     '''生产模式-普通模式'''
    #     iStep = self.EOL_Factory_WorkModels(Driver,'Factory',iStep)

    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x117,txCmd,0x217)
    #         with assume: assert receive_data[0:8] == [0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00]
    #         iStep = iStep + 1

    @allure.story('ECU EOL Test : ReadSoftVer No Security Certificatrere')
    @allure.title('Test eol test: ReadSoftVer No Security Certificatrere')
    @allure.description('Test eol test: ReadSoftVer No Security Certificatrere')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    def test_EOL_ReadSoftVer_NoSecurityCertificatrere_Phy(self,action,set_rbs,Driver):
        iStep = 1
        txCmd = [0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
        testMessage = '未安全认证-查询软件版本'
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
        with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x103,txCmd,0x203)
            with assume: assert receive_data == []
            iStep = iStep + 1

    # @allure.story('ECU EOL Test : ReadSoftVer No Factory Models')
    # @allure.title('Test eol test: ReadSoftVer No Factory Models')
    # @allure.description('Test eol test: ReadSoftVer No Factory Models')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # def test_EOL_ReadSoftVer_NoFactoryModels_Phy(self,action,set_rbs,Driver):
    #     iStep = 1
    #     txCmd = [0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
    #     testMessage = '未进生产模式-查询软件版本'
    #     iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x103,txCmd,0x203)
    #         with assume: assert receive_data == []
    #         iStep = iStep + 1


    # ids = ["Request {0}".format(binascii.b2a_hex(bytearray(req),' ')) for req in ReadSoftVer_Failed]
    # @allure.story('ECU EOL Test : ReadSoftVer Data Error')
    # @allure.title('Test eol test: ReadSoftVer Data Error')
    # @allure.description('Test eol test: ReadSoftVer Data Error')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # @pytest.mark.parametrize('req',ReadSoftVer_Failed,ids = ids)
    # def test_EOL_ReadSoftVer_DataError_Phy(self,action,set_rbs,Driver,req):
    #     iStep = 1
    #     txCmd = req
    #     testMessage = '查询软件版本数据错误'

    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     '''生产模式-普通模式'''
    #     iStep = self.EOL_Factory_WorkModels(Driver,'Factory',iStep)

    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x103,txCmd,0x203)
    #         with assume: assert receive_data[0] == 0x02
    #         iStep = iStep + 1

    @allure.story('ECU EOL Test : ReadHdVer No Security Certificatrere')
    @allure.title('Test eol test: ReadHdVer No Security Certificatrere')
    @allure.description('Test eol test: ReadHdVer No Security Certificatrere')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    def test_EOL_ReadHdVer_NoSecurityCertificatrere_Phy(self,action,set_rbs,Driver):
        iStep = 1
        txCmd = [0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
        testMessage = '未安全认证-查询硬件版本'
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
        with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x103,txCmd,0x203)
            with assume: assert receive_data == []
            iStep = iStep + 1

    # @allure.story('ECU EOL Test : ReadHdVer No Factory Models')
    # @allure.title('Test eol test: ReadHdVer No Factory Models')
    # @allure.description('Test eol test: ReadHdVer No Factory Models')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # def test_EOL_ReadHdVer_NoFactoryModels_Phy(self,action,set_rbs,Driver):
    #     iStep = 1
    #     txCmd = [0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
    #     testMessage = '未进生产模式-查询硬件版本'
    #     iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x103,txCmd,0x203)
    #         with assume: assert receive_data == []
    #         iStep = iStep + 1


    # ids = ["Request {0}".format(binascii.b2a_hex(bytearray(req),' ')) for req in ReadHdVer_Failed]
    # @allure.story('ECU EOL Test : ReadHdVer Data Error')
    # @allure.title('Test eol test: ReadHdVer Data Error')
    # @allure.description('Test eol test: ReadHdVer Data Error')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # @pytest.mark.parametrize('req',ReadHdVer_Failed,ids = ids)
    # def test_EOL_ReadHdVer_DataError_Phy(self,action,set_rbs,Driver,req):
    #     iStep = 1
    #     txCmd = req
    #     testMessage = '查询硬件版本数据错误'

    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     '''生产模式-普通模式'''
    #     iStep = self.EOL_Factory_WorkModels(Driver,'Factory',iStep)

    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x103,txCmd,0x203)
    #         with assume: assert receive_data[0] == 0x01
    #         iStep = iStep + 1


    @allure.story('ECU EOL Test : ReadCalibrationVer No Security Certificatrere')
    @allure.title('Test eol test: ReadCalibrationVer No Security Certificatrere')
    @allure.description('Test eol test: ReadCalibrationVer No Security Certificatrere')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    def test_EOL_ReadCalibrationVer_NoSecurityCertificatrere_Phy(self,action,set_rbs,Driver):
        iStep = 1
        txCmd = [0x83,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
        testMessage = '未安全认证-查询校准版本'
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
        with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x103,txCmd,0x203)
            with assume: assert receive_data == []
            iStep = iStep + 1

    # @allure.story('ECU EOL Test : ReadCalibrationVer No Factory Models')
    # @allure.title('Test eol test: ReadCalibrationVer No Factory Models')
    # @allure.description('Test eol test: ReadCalibrationVer No Factory Models')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # def test_EOL_ReadCalibrationVer_NoFactoryModels_Phy(self,action,set_rbs,Driver):
    #     iStep = 1
    #     txCmd = [0x83,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
    #     testMessage = '未进生产模式-查询校准版本'
    #     iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x103,txCmd,0x203)
    #         with assume: assert receive_data == []
    #         iStep = iStep + 1


    # ids = ["Request {0}".format(binascii.b2a_hex(bytearray(req),' ')) for req in ReadCalibrationVer_Failed]
    # @allure.story('ECU EOL Test : ReadCalibrationVer Data Error')
    # @allure.title('Test eol test: ReadCalibrationVer Data Error')
    # @allure.description('Test eol test: ReadCalibrationVer Data Error')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # @pytest.mark.parametrize('req',ReadCalibrationVer_Failed,ids = ids)
    # def test_EOL_ReadCalibrationVer_DataError_Phy(self,action,set_rbs,Driver,req):
    #     iStep = 1
    #     txCmd = req
    #     testMessage = '查询校准版本数据错误'

    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     '''生产模式-普通模式'''
    #     iStep = self.EOL_Factory_WorkModels(Driver,'Factory',iStep)

    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x103,txCmd,0x203)
    #         with assume: assert receive_data[0] == 0x01
    #         iStep = iStep + 1

    @allure.story('ECU EOL Test : WriteCalibrationVer No Security Certificatrere')
    @allure.title('Test eol test: WriteCalibrationVer No Security Certificatrere')
    @allure.description('Test eol test: WriteCalibrationVer No Security Certificatrere')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    def test_EOL_WriteCalibrationVer_NoSecurityCertificatrere_Phy(self,action,set_rbs,Driver):
        iStep = 1
        txCmd = [0x03,0x05,0x02,0x00,0x00,0x00,0x00,0x00]
        testMessage = '未安全认证-写入校准版本'
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
        with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x103,txCmd,0x203)
            with assume: assert receive_data == []
            iStep = iStep + 1

    # @allure.story('ECU EOL Test : WriteCalibrationVer No Factory Models')
    # @allure.title('Test eol test: WriteCalibrationVer No Factory Models')
    # @allure.description('Test eol test: WriteCalibrationVer No Factory Models')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # def test_EOL_WriteCalibrationVer_NoFactoryModels_Phy(self,action,set_rbs,Driver):
    #     iStep = 1
    #     txCmd = [0x03,0x05,0x02,0x00,0x00,0x00,0x00,0x00]
    #     testMessage = '未进生产模式-写入校准版本'
    #     iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x103,txCmd,0x203)
    #         with assume: assert receive_data == []
    #         iStep = iStep + 1

    # ids = ["Request {0}".format(binascii.b2a_hex(bytearray(req),' ')) for req in Ver_Failed]
    # @allure.story('ECU EOL Test : Ver Data Error')
    # @allure.title('Test eol test: Ver Data Error')
    # @allure.description('Test eol test: Ver Data Error')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # @pytest.mark.parametrize('req',Ver_Failed,ids = ids)
    # def test_EOL_Ver_DataError_Phy(self,action,set_rbs,Driver,req):
    #     iStep = 1
    #     txCmd = req
    #     testMessage = '版本查询与写入数据错误'

    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     '''生产模式-普通模式'''
    #     iStep = self.EOL_Factory_WorkModels(Driver,'Factory',iStep)

    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x103,txCmd,0x203)
    #         with assume: assert receive_data[0] & 0x80 != 0x80
    #         iStep = iStep + 1


    @allure.story('ECU EOL Test : Trigger_2DFFT No Security Certificatrere')
    @allure.title('Test eol test: Trigger_2DFFT No Security Certificatrere')
    @allure.description('Test eol test: Trigger_2DFFT No Security Certificatrere')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    def test_EOL_Trigger_2DFFT_NoSecurityCertificatrere_Phy(self,action,set_rbs,Driver):
        iStep = 1
        txCmd = [0x02,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]
        testMessage = '未安全认证-触发式发送2D-FFT模式'
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
        with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x153,txCmd,0x253)
            with assume: assert receive_data == []
            iStep = iStep + 1

    # @allure.story('ECU EOL Test : Trigger_2DFFT No Factory Models')
    # @allure.title('Test eol test: Trigger_2DFFT No Factory Models')
    # @allure.description('Test eol test: Trigger_2DFFT No Factory Models')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # def test_EOL_Trigger_2DFFT_NoFactoryModels_Phy(self,action,set_rbs,Driver):
    #     iStep = 1
    #     txCmd = [0x02,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]
    #     testMessage = '未进生产模式-触发式发送2D-FFT模式'
    #     iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x153,txCmd,0x253)
    #         with assume: assert receive_data == []
    #         iStep = iStep + 1

    # ids = ["Request {0}".format(binascii.b2a_hex(bytearray(req),' ')) for req in Trigger2DFFT_Failed]
    # @allure.story('ECU EOL Test : Trigger_2DFFT Data Error')
    # @allure.title('Test eol test: Trigger_2DFFT Data Error')
    # @allure.description('Test eol test: Trigger_2DFFT Data Error')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # @pytest.mark.parametrize('req',Trigger2DFFT_Failed,ids = ids)
    # def test_EOL_Trigger_2DFFT_DataError_Phy(self,action,set_rbs,Driver,req):
    #     iStep = 1
    #     txCmd = req
    #     testMessage = '触发式发送2D-FFT模式数据错误'

    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     '''生产模式-普通模式'''
    #     iStep = self.EOL_Factory_WorkModels(Driver,'Factory',iStep)

    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x153,txCmd,0x253)
    #         with assume: assert receive_data == []
    #         iStep = iStep + 1


    @allure.story('ECU EOL Test : GetDBFType No Security Certificatrere')
    @allure.title('Test eol test: GetDBFType No Security Certificatrere')
    @allure.description('Test eol test: GetDBFType No Security Certificatrere')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    def test_EOL_GetDBFType_NoSecurityCertificatrere_Phy(self,action,set_rbs,Driver):
        iStep = 1
        txCmd = [0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00]

        testMessage = '未安全认证-DBF因子的获取方式'
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
        with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x109,txCmd,0x209)
            with assume: assert receive_data == []
            iStep = iStep + 1

    # @allure.story('ECU EOL Test : GetDBFType No Factory Models')
    # @allure.title('Test eol test: GetDBFType No Factory Models')
    # @allure.description('Test eol test: GetDBFType No Factory Models')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # def test_EOL_GetDBFType_NoFactoryModels_Phy(self,action,set_rbs,Driver):
    #     iStep = 1
    #     txCmd = [0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00]
    #     testMessage = '未进生产模式-DBF因子的获取方式'
    #     iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x109,txCmd,0x209)
    #         with assume: assert receive_data == []
    #         iStep = iStep + 1

    # ids = ["Request {0}".format(binascii.b2a_hex(bytearray(req),' ')) for req in GetDBFType_Failed]
    # @allure.story('ECU EOL Test : GetDBFType Data Error')
    # @allure.title('Test eol test: GetDBFType Data Error')
    # @allure.description('Test eol test: GetDBFType Data Error')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # @pytest.mark.parametrize('req',GetDBFType_Failed,ids = ids)
    # def test_EOL_GetDBFType_DataError_Phy(self,action,set_rbs,Driver,req):
    #     iStep = 1
    #     txCmd = req
    #     testMessage = 'DBF因子的获取方式数据错误'

    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     '''生产模式-普通模式'''
    #     iStep = self.EOL_Factory_WorkModels(Driver,'Factory',iStep)

    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x109,txCmd,0x209)
    #         with assume: assert receive_data == []
    #         iStep = iStep + 1

    @allure.story('ECU EOL Test : WriteRCS No Security Certificatrere')
    @allure.title('Test eol test: WriteRCS No Security Certificatrere')
    @allure.description('Test eol test: WriteRCS No Security Certificatrere')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    def test_EOL_WriteRCS_NoSecurityCertificatrere_Phy(self,action,set_rbs,Driver):
        iStep = 1
        txCmd = [0x01,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]
        testMessage = '未安全认证-RCS标定值写入'
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
        with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x127,txCmd,0x227)
            with assume: assert receive_data == []
            iStep = iStep + 1

    # @allure.story('ECU EOL Test : WriteRCS No Factory Models')
    # @allure.title('Test eol test: WriteRCS No Factory Models')
    # @allure.description('Test eol test: WriteRCS No Factory Models')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # def test_EOL_WriteRCS_NoFactoryModels_Phy(self,action,set_rbs,Driver):
    #     iStep = 1
    #     txCmd = [0x01,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]
    #     testMessage = '未进生产模式-RCS标定值写入'
    #     iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x127,txCmd,0x227)
    #         with assume: assert receive_data == []
    #         iStep = iStep + 1


    # ids = ["Request {0}".format(binascii.b2a_hex(bytearray(req),' ')) for req in WriteRCS_Failed]
    # @allure.story('ECU EOL Test : WriteRCS Data Error')
    # @allure.title('Test eol test: WriteRCS Data Error')
    # @allure.description('Test eol test: WriteRCS Data Error')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # @pytest.mark.parametrize('req',WriteRCS_Failed,ids = ids)
    # def test_EOL_WriteRCS_DataError_Phy(self,action,set_rbs,Driver,req):
    #     iStep = 1
    #     txCmd = req
    #     testMessage = 'RCS标定值写入数据错误'

    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     '''生产模式-普通模式'''
    #     iStep = self.EOL_Factory_WorkModels(Driver,'Factory',iStep)

    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x127,txCmd,0x227)
    #         with assume: assert receive_data == []
    #         iStep = iStep + 1

    
    @allure.story('ECU EOL Test : SaveData No Security Certificatrere')
    @allure.title('Test eol test: SaveData No Security Certificatrere')
    @allure.description('Test eol test: SaveData No Security Certificatrere')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    def test_EOL_SaveData_NoSecurityCertificatrere_Phy(self,action,set_rbs,Driver):
        iStep = 1
        txCmd = [0xA1,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
        sendID = 0x116
        testMessage = '未安全认证-存储数据'
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
        with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x116,txCmd,0x216)
            with assume: assert receive_data == []
            iStep = iStep + 1

    
    # @allure.story('ECU EOL Test : SaveData No Factory Models')
    # @allure.title('Test eol test: SaveData No Factory Models')
    # @allure.description('Test eol test: SaveData No Factory Models')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # def test_EOL_SaveData_NoFactoryModels_Phy(self,action,set_rbs,Driver):
    #     iStep = 1
    #     txCmd = [0xA1,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
    #     testMessage = '未进生产模式-存储数据'
    #     iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x116,txCmd,0x216)
    #         with assume: assert receive_data == []
    #         iStep = iStep + 1


    # ids = ["Request {0}".format(binascii.b2a_hex(bytearray(req),' ')) for req in SaveData_Failed]
    # @allure.story('ECU EOL Test : SaveData Data Error')
    # @allure.title('Test eol test: SaveData Data Error')
    # @allure.description('Test eol test: SaveData Data Error')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # @pytest.mark.parametrize('req',SaveData_Failed,ids = ids)
    # def test_EOL_SaveData_DataError_Phy(self,action,set_rbs,Driver,req):
    #     iStep = 1
    #     txCmd = req
    #     testMessage = '存储数据数据错误'

    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     '''生产模式-普通模式'''
    #     iStep = self.EOL_Factory_WorkModels(Driver,'Factory',iStep)

    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x116,txCmd,0x216)
    #         with assume: assert receive_data == [0x00,0x22,0x22,0x22,0x22,0x22,0x22,0x22]
    #         iStep = iStep + 1

    @allure.story('ECU EOL Test : ChangeProfile No Security Certificatrere')
    @allure.title('Test eol test: ChangeProfile No Security Certificatrere')
    @allure.description('Test eol test: ChangeProfile No Security Certificatrere')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    def test_EOL_ChangeProfile_NoSecurityCertificatrere_Phy(self,action,set_rbs,Driver):
        iStep = 1
        txCmd = [0x02,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]
        testMessage = '未安全认证-切换Profile目标'
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
        with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x150,txCmd,0x250)
            with assume: assert receive_data == []
            iStep = iStep + 1

    
    # @allure.story('ECU EOL Test : ChangeProfile No Factory Models')
    # @allure.title('Test eol test: ChangeProfile No Factory Models')
    # @allure.description('Test eol test: ChangeProfile No Factory Models')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # def test_EOL_ChangeProfile_NoFactoryModels_Phy(self,action,set_rbs,Driver):
    #     iStep = 1
    #     txCmd = [0x02,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]
    #     testMessage = '未进生产模式-切换Profile目标'
    #     iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x150,txCmd,0x250)
    #         with assume: assert receive_data == []
    #         iStep = iStep + 1


    # ids = ["Request {0}".format(binascii.b2a_hex(bytearray(req),' ')) for req in ChangeProfile_Failed]
    # @allure.story('ECU EOL Test : ChangeProfile Data Error')
    # @allure.title('Test eol test: ChangeProfile Data Error')
    # @allure.description('Test eol test: ChangeProfile Data Error')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # @pytest.mark.parametrize('req',ChangeProfile_Failed,ids = ids)
    # def test_EOL_ChangeProfile_DataError_Phy(self,action,set_rbs,Driver,req):
    #     iStep = 1
    #     txCmd = req
    #     testMessage = '切换Profile目标数据错误'

    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     '''生产模式-普通模式'''
    #     iStep = self.EOL_Factory_WorkModels(Driver,'Factory',iStep)

    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x150,txCmd,0x250)
    #         with assume: assert receive_data == [0x00,0x22,0x22,0x22,0x22,0x22,0x22,0x22]
    #         iStep = iStep + 1


    @allure.story('ECU EOL Test : ResetDog No Security Certificatrere')
    @allure.title('Test eol test: ResetDog No Security Certificatrere')
    @allure.description('Test eol test: ResetDog No Security Certificatrere')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    def test_EOL_ResetDog_NoSecurityCertificatrere_Phy(self,action,set_rbs,Driver):
        iStep = 1
        txCmd = [0x31,0x58,0xAF,0x00,0x01,0x00,0x00,0x00]
   
        testMessage = '未安全认证-看门狗复位'
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
        with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x136,txCmd,0x236)
            with assume: assert receive_data == []
            iStep = iStep + 1


    # @allure.story('ECU EOL Test : ResetDog No Factory Models')
    # @allure.title('Test eol test: ResetDog No Factory Models')
    # @allure.description('Test eol test: ResetDog No Factory Models')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # def test_EOL_ResetDog_NoFactoryModels_Phy(self,action,set_rbs,Driver):
    #     iStep = 1
    #     txCmd = [0x31,0x58,0xAF,0x00,0x01,0x00,0x00,0x00]

    #     testMessage = '未进生产模式-看门狗复位'
    #     iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x136,txCmd,0x236)
    #         with assume: assert receive_data == []
    #         iStep = iStep + 1


    # ids = ["Request {0}".format(binascii.b2a_hex(bytearray(req),' ')) for req in ResetDog_Failed]
    # @allure.story('ECU EOL Test : ResetDog Data Error')
    # @allure.title('Test eol test: ResetDog Data Error')
    # @allure.description('Test eol test: ResetDog Data Error')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # @pytest.mark.parametrize('req',ResetDog_Failed,ids = ids)
    # def test_EOL_ResetDog_DataError_Phy(self,action,set_rbs,Driver,req):
    #     iStep = 1
    #     txCmd = req
    #     testMessage = '看门狗复位数据错误'

    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     '''生产模式-普通模式'''
    #     iStep = self.EOL_Factory_WorkModels(Driver,'Factory',iStep)

    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x136,txCmd,0x236)
    #         with assume: assert receive_data[0:5] == [0x31,0x58,0xAF,0x00,0x01]
    #         iStep = iStep + 1

    @allure.story('ECU EOL Test : QueryTime No Security Certificatrere')
    @allure.title('Test eol test: QueryTime No Security Certificatrere')
    @allure.description('Test eol test: QueryTime No Security Certificatrere')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    def test_EOL_QueryTime_NoSecurityCertificatrere_Phy(self,action,set_rbs,Driver):
        iStep = 1
        txCmd = [0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00]

        testMessage = '未安全认证-查询雷达系统时间戳'
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
        with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x142,txCmd,0x242)
            with assume: assert receive_data == []
            iStep = iStep + 1

    # @allure.story('ECU EOL Test : QueryTime No Factory Models')
    # @allure.title('Test eol test: QueryTime No Factory Models')
    # @allure.description('Test eol test: QueryTime No Factory Models')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # def test_EOL_QueryTime_NoFactoryModels_Phy(self,action,set_rbs,Driver):
    #     iStep = 1
    #     txCmd = [0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00]

    #     testMessage = '未进生产模式-查询雷达系统时间戳'
    #     iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x142,txCmd,0x242)
    #         with assume: assert receive_data == []
    #         iStep = iStep + 1


    # ids = ["Request {0}".format(binascii.b2a_hex(bytearray(req),' ')) for req in QueryTime_Failed]
    # @allure.story('ECU EOL Test : QueryTime Data Error')
    # @allure.title('Test eol test: QueryTime Data Error')
    # @allure.description('Test eol test: QueryTime Data Error')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # @pytest.mark.parametrize('req',QueryTime_Failed,ids = ids)
    # def test_EOL_QueryTime_DataError_Phy(self,action,set_rbs,Driver,req):
    #     iStep = 1
    #     txCmd = req
    #     testMessage = '查询雷达系统时间戳数据错误'

    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     '''生产模式-普通模式'''
    #     iStep = self.EOL_Factory_WorkModels(Driver,'Factory',iStep)

    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x142,txCmd,0x242)
    #         if req[0] == 0x81:
    #             with assume: assert receive_data == []
    #         else:
    #             with assume: assert receive_data == 0x00
    #         iStep = iStep + 1


    @allure.story('ECU EOL Test : WritePhaseDifference No Security Certificatrere')
    @allure.title('Test eol test: WritePhaseDifference No Security Certificatrere')
    @allure.description('Test eol test: WritePhaseDifference No Security Certificatrere')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    def test_EOL_WritePhaseDifference_NoSecurityCertificatrere_Phy(self,action,set_rbs,Driver):
        iStep = 1
        txCmd = [0x01,0x02,0x03,0x00,0x00,0x00,0x00,0x00]
    
        testMessage = '未安全认证-曲线拟合的天线间距及相位差写入'
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x114,txCmd,0x214)
            with assume: assert receive_data == []
            iStep = iStep + 1

    
    # @allure.story('ECU EOL Test : WritePhaseDifference No Factory Models')
    # @allure.title('Test eol test: WritePhaseDifference No Factory Models')
    # @allure.description('Test eol test: WritePhaseDifference No Factory Models')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # def test_EOL_WritePhaseDifference_NoFactoryModels_Phy(self,action,set_rbs,Driver):
    #     iStep = 1
    #     txCmd = [0x01,0x02,0x03,0x00,0x00,0x00,0x00,0x00]
        
    #     testMessage = '未进生产模式-曲线拟合的天线间距及相位差写入'
    #     iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)

    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x114,txCmd,0x214)
    #         with assume: assert receive_data == []
    #         iStep = iStep + 1



    @allure.story('ECU EOL Test : MountID No Security Certificatrere')
    @allure.title('Test eol test: MountID No Security Certificatrere')
    @allure.description('Test eol test: MountID No Security Certificatrere')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    def test_EOL_MountID_NoSecurityCertificatrere_Phy(self,action,set_rbs,Driver):
        iStep = 1
        txCmd = [0x00,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]
        
        testMessage = '未安全认证-Mount ID_Pin7/Pin8引脚状态检测'
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x156,txCmd,0x256)
            with assume: assert receive_data == []
            iStep = iStep + 1

    
    # @allure.story('ECU EOL Test : MountID No Factory Models')
    # @allure.title('Test eol test: MountID No Factory Models')
    # @allure.description('Test eol test: MountID No Factory Models')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # def test_EOL_MountID_NoFactoryModels_Phy(self,action,set_rbs,Driver):
    #     iStep = 1
    #     txCmd = [0x00,0x31,0x58,0xAF,0x00,0x00,0x00,0x00]
        
    #     testMessage = '未进生产模式-Mount ID_Pin7/Pin8引脚状态检测'
    #     iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)

    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x156,txCmd,0x256)
    #         with assume: assert receive_data == []
    #         iStep = iStep + 1


    # ids = ["Request {0}".format(binascii.b2a_hex(bytearray(req),' ')) for req in MountID_Failed]
    # @allure.story('ECU EOL Test : MountID Data Error')
    # @allure.title('Test eol test: MountID Data Error')
    # @allure.description('Test eol test: MountID Data Error')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # @pytest.mark.parametrize('req',MountID_Failed,ids = ids)
    # def test_EOL_MountID_DataError_Phy(self,action,set_rbs,Driver,req):
    #     iStep = 1
    #     txCmd = req
    #     testMessage = 'Mount ID_Pin7/Pin8引脚状态检测数据错误'

    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     '''生产模式-普通模式'''
    #     iStep = self.EOL_Factory_WorkModels(Driver,'Factory',iStep)

    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x156,txCmd,0x256)
    #         with assume: assert receive_data == []

    #         iStep = iStep + 1


    
    @allure.story('ECU EOL Test : ReadVoltage No Security Certificatrere')
    @allure.title('Test eol test: ReadVoltage No Security Certificatrere')
    @allure.description('Test eol test: ReadVoltage No Security Certificatrere')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    def test_EOL_ReadVoltage_NoSecurityCertificatrere_Phy(self,action,set_rbs,Driver):
        iStep = 1
        txCmd = [0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
        
        testMessage = '未安全认证-读PCBA电压'
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x140,txCmd,0x240)
            with assume: assert receive_data == []
            iStep = iStep + 1

    
    # @allure.story('ECU EOL Test : ReadVoltage No Factory Models')
    # @allure.title('Test eol test: ReadVoltage No Factory Models')
    # @allure.description('Test eol test: ReadVoltage No Factory Models')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # def test_EOL_ReadVoltage_NoFactoryModels_Phy(self,action,set_rbs,Driver):
    #     iStep = 1
    #     txCmd = [0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
        
    #     testMessage = '未进生产模式-读PCBA电压'
    #     iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)

    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x140,txCmd,0x240)
    #         with assume: assert receive_data == []
    #         iStep = iStep + 1


    # ids = ["Request {0}".format(binascii.b2a_hex(bytearray(req),' ')) for req in ReadVoltage_Failed]
    # @allure.story('ECU EOL Test : ReadVoltage Data Error')
    # @allure.title('Test eol test: ReadVoltage Data Error')
    # @allure.description('Test eol test: ReadVoltage Data Error')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # @pytest.mark.parametrize('req',ReadVoltage_Failed,ids = ids)
    # def test_EOL_ReadVoltage_DataError_Phy(self,action,set_rbs,Driver,req):
    #     iStep = 1
    #     txCmd = req
    #     testMessage = '读PCBA电压数据错误'

    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     '''生产模式-普通模式'''
    #     iStep = self.EOL_Factory_WorkModels(Driver,'Factory',iStep)

    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x140,txCmd,0x240)
    #         with assume: assert receive_data[0] & 0x10 == 0x10

    #         iStep = iStep + 1


    @allure.story('ECU EOL Test : TransAndWriteDBF No Security Certificatrere')
    @allure.title('Test eol test: TransAndWriteDBF No Security Certificatrere')
    @allure.description('Test eol test: TransAndWriteDBF No Security Certificatrere')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    def test_EOL_TransAndWriteDBF_NoSecurityCertificatrere_Phy(self,action,set_rbs,Driver):
        iStep = 1
        txCmd = [0x8D,0x00,0x1C,0x70,0x00,0x00,0x10,0x00]

        testMessage = '未安全认证-传递与写入DBF因子'
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
            logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
            receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x154,txCmd,0x254)
            with assume: assert receive_data == []
            iStep = iStep + 1

    
    # @allure.story('ECU EOL Test : TransAndWriteDBF No Factory Models')
    # @allure.title('Test eol test: TransAndWriteDBF No Factory Models')
    # @allure.description('Test eol test: TransAndWriteDBF No Factory Models')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # def test_EOL_TransAndWriteDBF_NoFactoryModels_Phy(self,action,set_rbs,Driver):
    #     iStep = 1
    #     txCmd = [0x8D,0x00,0x1C,0x70,0x00,0x00,0x10,0x00]

    #     testMessage = '未进生产模式-传递与写入DBF因子'
    #     iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)

    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x154,txCmd,0x254)
    #         with assume: assert receive_data == []
    #         iStep = iStep + 1


    # ids = ["Request {0}".format(binascii.b2a_hex(bytearray(req),' ')) for req in TransAndWriteDBF_Failed]
    # @allure.story('ECU EOL Test : TransAndWriteDBF Data Error')
    # @allure.title('Test eol test: TransAndWriteDBF Data Error')
    # @allure.description('Test eol test: TransAndWriteDBF Data Error')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/62a69d6cb35db4f20e37703a/cases')
    # @pytest.mark.parametrize('req',TransAndWriteDBF_Failed,ids = ids)
    # def test_EOL_TransAndWriteDBF_DataError_Phy(self,action,set_rbs,Driver,req):
    #     iStep = 1
    #     txCmd = req
    #     testMessage = '传递与写入DBF因子数据错误'

    #     '''安全认证'''
    #     iStep = self.EOL_SecurityCertificate(Driver,iStep)
    #     '''生产模式-普通模式'''
    #     iStep = self.EOL_Factory_WorkModels(Driver,'Factory',iStep)

    #     with allure.step(f"Step{iStep}:{testMessage} # {testMessage}返回"):
    #         logging.info(f"^^^^^^^^^^^^^^{testMessage}^^^^^^^^^^^^^^")
    #         receive_data =  Driver['CAN'].SendAndRead_Eol(Driver, 0x154,txCmd,0x254)
    #         with assume: assert receive_data[1] & 0x40 == 0x40

    #         iStep = iStep + 1
        
        